package com.zzg.mybatis.generator.model;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import org.mybatis.generator.api.dom.java.Field;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by Owen on 6/22/16.
 */
public class UITableQueryColumnVO {

    private BooleanProperty checked = new SimpleBooleanProperty(true); // Default set to true

    private StringProperty columnName = new SimpleStringProperty();

    private BooleanProperty ruzzyQuery = new SimpleBooleanProperty(false);

    private StringProperty jdbcType = new SimpleStringProperty();

    private BooleanProperty rangeQuery = new SimpleBooleanProperty(false);

    private BooleanProperty orderBy = new SimpleBooleanProperty(false);

    private Map<String, Field> fieldMap = new LinkedHashMap<>();

    public Map<String, Field> getFieldMap() {
        return fieldMap;
    }

    public void setFieldMap(Map<String, Field> fieldMap) {
        this.fieldMap = fieldMap;
    }


    public void putFieldMap(String name, Field field) {
        this.fieldMap.put(name, field);
    }

    public String getColumnName() {
        return columnName.get();
    }

    public void setColumnName(String columnName) {
        this.columnName.set(columnName);
    }

    public String getJdbcType() {
        return jdbcType.get();
    }

    public void setJdbcType(String jdbcType) {
        this.jdbcType.set(jdbcType);
    }

    public BooleanProperty checkedProperty() {
        return checked;
    }

    public Boolean getChecked() {
        return this.checked.get();
    }

    public void setChecked(Boolean checked) {
        this.checked.set(checked);
    }

    public StringProperty columnNameProperty() {
        return columnName;
    }

    public StringProperty jdbcTypeProperty() {
        return jdbcType;
    }

    public void setChecked(boolean checked) {
        this.checked.set(checked);
    }

    public BooleanProperty ruzzyQueryProperty() {
        return ruzzyQuery;
    }

    public void setRuzzyQuery(boolean ruzzyQuery) {
        this.ruzzyQuery.set(ruzzyQuery);
    }

    public BooleanProperty rangeQueryProperty() {
        return rangeQuery;
    }

    public void setRangeQuery(boolean rangeQuery) {
        this.rangeQuery.set(rangeQuery);
    }

    public boolean isChecked() {
        return checked.get();
    }

    public boolean isRuzzyQuery() {
        return ruzzyQuery.get();
    }

    public boolean isRangeQuery() {
        return rangeQuery.get();
    }

    public boolean isOrderBy() {
        return orderBy.get();
    }

    public BooleanProperty orderByProperty() {
        return orderBy;
    }

    public void setOrderBy(boolean orderBy) {
        this.orderBy.set(orderBy);
    }
}
